package com.ycode.bang.anbang.utils;

import android.os.CountDownTimer;
import android.widget.TextView;

public class TimeCount extends CountDownTimer {
	private TextView view;

	public TimeCount(long millisInFuture, long countDownInterval, TextView v) {
		super(millisInFuture, countDownInterval);// 参数依次为总时长,和计时的时间间隔
		this.view = v;
	}

	@Override
	public void onFinish() {// 计时完毕时触发
		view.setText("重新发送");
		view.setClickable(true);
	}

	@Override
	public void onTick(long millisUntilFinished) {// 计时过程显示
		view.setClickable(false);
		view.setText(millisUntilFinished / 1000 + "秒");
	}
}
